<nav class="navbar navbar-default" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="<?php echo base_url(); ?>">
                <span class="blue">热辣</span>
                <span class="red">妹子</span>
            </a>
        </div>

        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <?php echo form_open($this->route_links->get('search_page'), 'method="get" class="wSearch search_form navbar-form navbar-left"'); ?>

            <div class="input-group">
                <input type="text" name="q" class="form-control input-sm sk" placeholder="Search">
                  <span class="input-group-btn">
                    <button type="submit" class="btn btn-default btn-sm"><i class="fa fa-search"></i>
                    </button>
                  </span>
            </div>

            <?php echo form_close(); ?>
            <ul class="nav navbar-nav navbar-right">
                <li class="<?php echo active_url($this->route_links->get('category_page_index')) ?>"><a
                        href="<?php echo $this->route_links->build_link('category_page_index'); ?>">妹子分类</a>
                </li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle"
                       data-toggle="dropdown">壁纸排行 <b
                            class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="<?php echo $this->route_links->build_link('wallpapers_latest_page'); ?>">最新妹子</a>
                        </li>
                        <li>
                            <a href="<?php echo $this->route_links->build_link('wallpapers_downloads_page'); ?>">热门下载</a>
                        </li>
                        <li>
                            <a href="<?php echo $this->route_links->build_link('wallpapers_views_page'); ?>">浏览最多</a>
                        </li>
                        <li>
                            <a href="<?php echo $this->route_links->build_link('wallpapers_favourites_page'); ?>">收藏最多</a>
                        </li>
                        <li>
                            <a href="<?php echo $this->route_links->build_link('wallpapers_rating_page'); ?>">评分最高</a>
                        </li>
                        <li>
                            <a href="<?php echo $this->route_links->build_link('wallpapers_random_page'); ?>">随机推荐</a>
                        </li>
                    </ul>
                </li>
                <?php if ($this->user->is_loggedIn()) { ?>
                    <li class="<?php echo active_url($this->route_links->get('upload_wallpaper')) ?>"><a
                            href="<?php echo $this->route_links->build_link('upload_wallpaper'); ?>">
                            <i class="fa fa-cloud-upload fa-big"></i> 上传壁纸 </a></li>
                    <li class="dropdown <?php echo active_url($this->route_links->get('account_index')); ?>">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i
                                class="fa fa-user fa-big"></i> 用户中心 <b
                                class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li>
                                <a href="<?php echo $this->route_links->build_link('account_index'); ?>">
                                    <i class="fa fa-user"></i>
                                    个人设置
                                </a>
                            </li>
                            <li class="divider"></li>
                            <?php if ($this->user->is_admin()) { ?>
                                <li>
                                    <a href="<?php echo base_url(config_item('admin_folder')); ?>">
                                        <i class="fa fa-dashboard"></i>
                                        管理后台
                                    </a>
                                </li>
                            <?php } ?>
                            <li>
                                <a href="<?php echo $this->route_links->build_link('account_logout'); ?>"><i
                                        class="fa fa-sign-out"></i> 退出
                                </a>
                            </li>
                        </ul>
                    </li>
                <?php } else { ?>
                    <li>
                        <a href="<?php echo $this->route_links->build_link('account_login'); ?>">
                            <i class="fa fa-sign-in fa-big"></i>
                            会员登陆
                        </a>
                    </li>
                <?php } ?>
            </ul>
        </div>
    </div>
</nav>



<?php if ($this->session->flashdata('FLASH_ERROR')) { ?>
    <div class="FLASH_ERROR hide"><?php echo $this->session->flashdata('FLASH_ERROR'); ?></div>
<?php } ?>
<?php if ($this->session->flashdata('FLASH_MSG')) { ?>
    <div class="FLASH_MSG hide"><?php echo $this->session->flashdata('FLASH_MSG'); ?></div>
<?php } ?>
